package net.lzzy.chapter426;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

//public class TsetStudentCompartor {
//    public static void main(String[] args) {
//        /* 传参 */
//        Student s1 = new Student("张三",85.2,20);
//        Student s2 = new Student("李四",82.3,19);
//        Student s3 = new Student("王五",86.7,21);
//        Student s4 = new Student("赵六",90.2,22);
//        Student s5 = new Student("韦七",87.7,20);
//        Student s6 = new Student("朱八",92.7,22);
//
//        List<Student> students = Arrays.asList(s1,s2,s3,s4,s5,s6);
//
//         /* 逆向排序(降序) */
//        Collections.sort(students,new StudentCompartor());
//        Collections.reverse(students);
//        Collections.reverseOrder(new StudentCompartor());
//
//        /* (求最大值与最小值) */
//        Student scoreMax = Collections.max(students,new StudentCompartor());
//        Student scoreMin = Collections.min(students,new StudentCompartor());
//
//        /* 遍历输出降序, 输出最大值与最小值 */
//        for(Student student:students){
//            System.out.println(student.getScore());
//        }
//        System.out.println(scoreMax+"\n"+scoreMin);
//    }
//}
